import {defineStore} from 'pinia'
import axios from "axios";

export const useStore = defineStore({
        id: 'user',
        state: () => ({
            user: {
                username: '',
                email: '',
                role: '',
                registerTime: null,
                avatar: null
            }
        }),
        getters: {
            getAvatarURL: (state) => state.user.avatar ? `${axios.defaults.baseURL}/images${state.user.avatar}` : 'https://blog.shenjianl.cn/aisi-coding/logo.svg',
        }
    }
)